<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib  prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<c:set var="ctx" value="${pageContext.request.contextPath }"/>
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
	<meta charset="utf-8" />
	<title>固定资产管理系统</title>
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta content="width=device-width, initial-scale=1.0" name="viewport" />
	<meta content="" name="description" />
	<meta content="" name="author" />
	<meta name="MobileOptimized" content="320">
	<!-- BEGIN GLOBAL MANDATORY STYLES -->
	<link href="${ctx}/assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"/>
	<!-- END GLOBAL MANDATORY STYLES -->	
	<!-- BEGIN THEME STYLES --> 
	<link href="${ctx}/assets/css/style-metronic.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/style.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/style-responsive.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/plugins.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/pages/tasks.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/themes/light.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/custom.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/css/custom.css" rel="stylesheet" type="text/css"/>

	<link rel="stylesheet" type="text/css" href="${ctx}/assets/plugins/select2/select2_metro.css" />
	<link rel="stylesheet" href="${ctx}/assets/plugins/data-tables/DT_bootstrap.css" />
	
	<link href="${ctx}/assets/plugins/bootstrap-modal/css/bootstrap-modal-bs3patch.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/plugins/bootstrap-modal/css/bootstrap-modal.css" rel="stylesheet" type="text/css"/>
	<!-- END THEME STYLES -->
	<link rel="shortcut icon" href="favicon.ico" />
	<style type="text/css">
		.page-content{
			min-height:900px;
		}
	</style>
</head>
<body class="page-header-fixed">
	<!-- BEGIN HEADER -->
	<%@include file="../include/header.jsp" %>
	<!-- END HEADER -->
	<div class="clearfix"></div>
	<!-- BEGIN CONTAINER -->
	<div class="page-container">
		<!-- BEGIN SIDEBAR -->
		<%@include file="../include/sidebar.jsp" %>
		<!-- END SIDEBAR -->
		<!-- BEGIN PAGE -->
		<div class="page-content">			
			<div class="row">
				<div class="col-md-12">
					<!-- BEGIN PAGE TITLE & BREADCRUMB-->
					<h3 class="page-title">
						物资移交流程
					</h3>
					
					<!-- END PAGE TITLE & BREADCRUMB-->
				</div>
			</div>
			<!-- END PAGE HEADER-->
			<!-- BEGIN PAGE CONTENT-->
			<div class="row">
				<div class="col-md-12">
					<!-- BEGIN TAB PORTLET-->   
					<div class="portlet box green tabbable">
						<div class="portlet-title">
							<div class="caption"><i class="fa fa-reorder"></i>移交流程待办</div>
						</div>
						<div class="portlet-body">
							<div class=" portlet-tabs">
								<ul class="nav nav-tabs">
									<c:if test="${!empty yiJiaoList507}"><li><a href="#portlet_tab507" data-toggle="tab">部门负责人审批</a></li></c:if>
									<c:if test="${!empty yiJiaoList508}"><li><a href="#portlet_tab508" data-toggle="tab">归口部门负责人审批</a></li></c:if>

									<!--<shiro:hasRole name="固资管理员"><c:if test="${!empty yiJiaoLiuCheng}"><li><a href="#portlet_tab4" data-toggle="tab" id="yjlcglTab">流程管理</a></li></c:if></shiro:hasRole>-->
									<shiro:hasRole name="固资管理员"><c:if test="${!empty yiJiaoRZ}"><li><a href="#portlet_tab3" data-toggle="tab" id="yjrzTab">移交确认</a></li></c:if></shiro:hasRole>
									<shiro:hasRole name="固资管理员"><c:if test="${!empty yiJiaoFaFang}"><li><a href="#portlet_tab2" data-toggle="tab">移交发放</a></li></c:if></shiro:hasRole>
									<shiro:hasRole name="固资管理员"><c:if test="${!empty yiJiaoList}"><li><a href="#portlet_tab1" data-toggle="tab" id="yjspTab">移交审批</a></li></c:if></shiro:hasRole>

									<c:if test="${!empty yiJiaoCaiWu}"><li><a href="#portlet_tab5" data-toggle="tab">移交通知</a></li></c:if>
								</ul>
								<div class="tab-content">
									<div class="tab-pane <c:if test="${active==1}">active</c:if>" id="portlet_tab0">
										<div class="portlet-body">
											<form method="POST" id="yjjsForm">
												<c:if test="${not empty yiJiaoJieShou }">
													<div style="text-align:right;">
														<a class="btn blue" id="yjjsPL"><i class="fa fa-search"></i>&nbsp;&nbsp;批量接收</a>&nbsp;&nbsp;
														<a class="btn red" id="yjjsBHPL"><i class="fa fa-search"></i>&nbsp;&nbsp;批量退回</a>
													</div>
												</c:if>
												<div class="table-scrollable">
													<table class="table table-striped table-bordered table-hover" id="sample_1">
														<thead>
															<tr>
																<th><input type="checkbox" id="yjjsAll"></th>	
																<th>申请日期</th>
																<th>移交人</th>
																<th>移交原因</th>
																<th>资产编号</th>
																<th>物资名称</th>
																<th>品牌</th>
																<th>规格型号</th>
																<th>查看</th>																			
																<th>操作</th>
															</tr>
														</thead>
														<tbody id="yjjs">
														</tbody>
													</table>
												</div>
											</form>
										</div>
									</div>
									<div class="tab-pane <c:if test="${active==2}">active</c:if>" id="portlet_tab1">
										<div class="portlet-body">
											<form method="POST" id="yjspForm">
												<div style="text-align:right;">
													<a class="btn blue" id="yjspPiSubmit"><i class="fa fa-search"></i>&nbsp;&nbsp;批量同意</a>&nbsp;&nbsp;
													<a class="btn red" id="boHuiPL"><i class="fa fa-search"></i>&nbsp;&nbsp;批量驳回</a>
												</div>
												<div class="table-scrollable">
													<table class="table table-striped table-bordered table-hover" id="sample_1">
														<thead>
															<tr>
																<th><input type="checkbox" id="yjspSelectAll"></th>	
																<th>申请日期</th>
																<th>移交人</th>
																<th>移交原因</th>
																<th>资产编号</th>
																<th>物资名称</th>
																<th>品牌</th>
																<th>规格型号</th>
																<th>接收部门</th>
																<th>接收人</th>
																<th>查看</th>																					
																<th>操作</th>
															</tr>
														</thead>
														<tbody id="yjsp">
														</tbody>
													</table>
												</div>
											</form>
										</div>
									</div>
									<div class="tab-pane" id="portlet_tab507">
										<div class="portlet-body">
											<form method="POST" id="yiJiaoForm">
												<div style="text-align:right;">
													<a class="btn blue" href="javascript:plTongGuo();"><i class="fa fa-search"></i>&nbsp;&nbsp;批量同意</a>&nbsp;
												</div>
												<div class="table-scrollable">
													<table class="table table-striped table-bordered table-hover">
														<thead>
														<tr>
															<th><input type="checkbox"></th>
															<th>申请日期</th>
															<th>移交人</th>
															<th>移交原因</th>
															<th>资产编号</th>
															<th>物资名称</th>
															<th>品牌</th>
															<th>规格型号</th>
															<th>接收部门</th>
															<th>接收人</th>
															<th>查看</th>
															<th>操作</th>
														</tr>
														</thead>
														<tbody>
														<c:forEach items="${yiJiaoList507 }" var="u">
															<tr>
																<td><input type="checkbox" name="yiJiaoId" value="${u.id }"></td>
																<td><fmt:formatDate value="${u.shenQingRQ }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
																<td>${u.yiJiaoR.name }</td>
																<td>${u.yiJiaoYY }</td>
																<td>${u.wuZi.ziChanBH }</td>
																<td>${u.wuZi.wuZiMC }</td>
																<td>${u.wuZi.pinPai }</td>
																<td>${u.wuZi.guiGeXH }</td>
																<td>${u.jieShouDW.depName }</td>
																<td>${u.jieShouR.name }</td>
																<td>
																	<a href="${ctx }/wuzi/wuZiDetail.do?id=${u.wuZi.id}" target="_blank" class="btn default btn-xs green-stripe">物资详情</a>&nbsp;&nbsp;
																	<a href="${ctx }/wuzi/yiJiaoDetail.do?id=${u.id}" target="_blank" class="btn default btn-xs green-stripe">流程详情</a>
																</td>
																<td>
																	<a href="javascript:yiJiaoLiuChengTongGuo('${u.id }')" class="btn default btn-xs green-stripe">同意</a>&nbsp;&nbsp;
																</td>
															</tr>
														</c:forEach>
														</tbody>
													</table>
												</div>
											</form>
										</div>
									</div>
									<div class="tab-pane" id="portlet_tab508">
										<div class="portlet-body">
											<form method="POST" id="yiJiaoForm508">
												<div style="text-align:right;">
													<a class="btn blue" href="javascript:plTongGuo508();"><i class="fa fa-search"></i>&nbsp;&nbsp;批量同意</a>&nbsp;
												</div>
												<div class="table-scrollable">
													<table class="table table-striped table-bordered table-hover">
														<thead>
														<tr>
															<th><input type="checkbox"></th>
															<th>申请日期</th>
															<th>移交人</th>
															<th>移交原因</th>
															<th>资产编号</th>
															<th>物资名称</th>
															<th>品牌</th>
															<th>规格型号</th>
															<th>接收部门</th>
															<th>接收人</th>
															<th>查看</th>
															<th>操作</th>
														</tr>
														</thead>
														<tbody>
														<c:forEach items="${yiJiaoList508 }" var="u">
															<tr>
																<td><input type="checkbox" name="yiJiaoId" value="${u.id }"></td>
																<td><fmt:formatDate value="${u.shenQingRQ }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
																<td>${u.yiJiaoR.name }</td>
																<td>${u.yiJiaoYY }</td>
																<td>${u.wuZi.ziChanBH }</td>
																<td>${u.wuZi.wuZiMC }</td>
																<td>${u.wuZi.pinPai }</td>
																<td>${u.wuZi.guiGeXH }</td>
																<td>${u.jieShouDW.depName }</td>
																<td>${u.jieShouR.name }</td>
																<td>
																	<a href="${ctx }/wuzi/wuZiDetail.do?id=${u.wuZi.id}" target="_blank" class="btn default btn-xs green-stripe">物资详情</a>&nbsp;&nbsp;
																	<a href="${ctx }/wuzi/yiJiaoDetail.do?id=${u.id}" target="_blank" class="btn default btn-xs green-stripe">流程详情</a>
																</td>
																<td>
																	<a href="javascript:yiJiaoLiuChengTongGuo('${u.id }')" class="btn default btn-xs green-stripe">同意</a>&nbsp;&nbsp;
																</td>
															</tr>
														</c:forEach>
														</tbody>
													</table>
												</div>
											</form>
										</div>
									</div>
									<div class="tab-pane <c:if test="${active==3}">active</c:if>" id="portlet_tab2">
										<div class="portlet-body">
											<div class="table-scrollable">
												<table class="table table-striped table-bordered table-hover" id="sample_1">
													<thead>
														<tr>
															<th>申请日期</th>
															<th>移交人</th>
															<th>移交原因</th>
															<th>资产编号</th>
															<th>物资名称</th>
															<th>品牌</th>
															<th>规格型号</th>														
															<th>查看</th>																				
															<th>操作</th>
														</tr>
													</thead>
													<tbody id="yjff">
														<c:forEach items="${yiJiaoFaFang }" var="u">													
														<tr>
															<td><fmt:formatDate value="${u.shenQingRQ }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
															<td>${u.yiJiaoR.name }</td>
															<td>${u.yiJiaoYY }</td>
															<td>${u.wuZi.ziChanBH }</td>
															<td>${u.wuZi.wuZiMC }</td>
															<td>${u.wuZi.pinPai }</td>
															<td>${u.wuZi.guiGeXH }</td>
															<td>
																<a href="${ctx }/wuzi/wuZiDetail.do?id=${u.wuZi.id}" target="_blank" class="btn default btn-xs green-stripe">物资详情</a>&nbsp;&nbsp;
																<a href="${ctx }/wuzi/yiJiaoDetail.do?id=${u.id}" target="_blank" class="btn default btn-xs green-stripe">流程详情</a>
															</td>														
															<td>
																
																<a href="${ctx }/wuzi/yiJiaoFaFang.do?id=${u.id}" target="_blank" class="btn default btn-xs green-stripe">移交发放</a>
															</td>
														</tr>
														</c:forEach>													
													</tbody>
												</table>
											</div>
										</div>
									</div>
									<div class="tab-pane <c:if test="${active==4}">active</c:if>" id="portlet_tab3">
										<div class="portlet-body">
											<form method="POST" id="yjrzForm">
												<div style="text-align:right;">
													<a class="btn blue" id="yjrzPiSubmit"><i class="fa fa-search"></i>&nbsp;&nbsp;批量同意</a>
												</div>
												<div class="table-scrollable">
													<table class="table table-striped table-bordered table-hover" id="sample_1">
														<thead>
															<tr>
																<th><input type="checkbox" id="yjrzSelectAll"></th>	
																<th>申请日期</th>
																<th>移交人</th>
																<th>移交原因</th>
																<th>资产编号</th>
																<th>物资名称</th>
																<th>品牌</th>
																<th>规格型号</th>
																<th>接收部门</th>
																<th>接收人</th>																					
																<th>操作</th>
															</tr>
														</thead>
														<tbody id="yjrz">
														</tbody>
													</table>
												</div>
											</form>
										</div>
									</div>
									<div class="tab-pane <c:if test="${active==5}">active</c:if>" id="portlet_tab4">
										<div class="portlet-body">
											<div class="table-scrollable">
												<table class="table table-striped table-bordered table-hover" id="sample_1">
													<thead>
														<tr>
															<th>申请日期</th>
															<th>申请原因</th>
															<th>申请部门</th>
															<th>申请人</th>
															<th>当前环节</th>
															<th>邮件催办</th>
															<th>流程回退</th>
														</tr>
													</thead>
													<tbody id="yjlcgl">
													</tbody>
												</table>
											</div>
										</div>
									</div>
									<div class="tab-pane" id="portlet_tab5">
										<div class="portlet-body">
											<div class="table-scrollable">
												<table class="table table-striped table-bordered table-hover">
													<thead>
													<tr>
														<th>申请日期</th>
														<th>移交人</th>
														<th>移交原因</th>
														<th>资产编号</th>
														<th>物资名称</th>
														<th>品牌</th>
														<th>规格型号</th>
														<th>查看</th>
													</tr>
													</thead>
													<tbody>
													<c:forEach items="${yiJiaoCaiWu }" var="u">
														<tr>
															<td><fmt:formatDate value="${u.shenQingRQ }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
															<td>${u.yiJiaoR.name }</td>
															<td>${u.yiJiaoYY }</td>
															<td>${u.wuZi.ziChanBH }</td>
															<td>${u.wuZi.wuZiMC }</td>
															<td>${u.wuZi.pinPai }</td>
															<td>${u.wuZi.guiGeXH }</td>
															<td>
																<a href="${ctx }/wuzi/wuZiDetail.do?id=${u.wuZi.id}" target="_blank" class="btn default btn-xs green-stripe">物资详情</a>&nbsp;&nbsp;
																<a href="${ctx }/wuzi/yiJiaoDetail.do?id=${u.id}" target="_blank" class="btn default btn-xs green-stripe">流程详情</a>
															</td>
														</tr>
													</c:forEach>
													</tbody>
												</table>
											</div>
										</div>
									</div>
								</div>			
							</div>
						</div>
					</div>					
				</div>
			</div>
			
			<!-- END PAGE CONTAINER-->			
		</div>
		<!-- END PAGE -->
	</div>
	<!-- END CONTAINER -->
	<!-- BEGIN FOOTER -->
	<%@include file="../include/footer.jsp" %>
	<!-- END FOOTER -->
	<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
	<!-- BEGIN CORE PLUGINS -->   
	<!--[if lt IE 9]>
	<script src="${ctx}/assets/plugins/respond.min.js"></script>
	<script src="${ctx}/assets/plugins/excanvas.min.js"></script> 
	<![endif]-->   
	<script src="${ctx}/assets/plugins/jquery-1.10.2.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>   
	<!-- IMPORTANT! Load jquery-ui-1.10.3.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->
	<script src="${ctx}/assets/plugins/jquery-ui/jquery-ui-1.10.3.custom.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/bootstrap-hover-dropdown/twitter-bootstrap-hover-dropdown.min.js" type="text/javascript" ></script>
	<script src="${ctx}/assets/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/jquery.blockui.min.js" type="text/javascript"></script>  
	<script src="${ctx}/assets/plugins/jquery.cookie.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/uniform/jquery.uniform.min.js" type="text/javascript" ></script>
	<!-- END CORE PLUGINS -->
	
	<!-- IMPORTANT! fullcalendar depends on jquery-ui-1.10.3.custom.min.js for drag & drop support -->
	<script src="${ctx}/assets/plugins/fullcalendar/fullcalendar/fullcalendar.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/jquery-easy-pie-chart/jquery.easy-pie-chart.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/jquery.sparkline.min.js" type="text/javascript"></script>  
	<!-- END PAGE LEVEL PLUGINS -->
	<!-- BEGIN PAGE LEVEL SCRIPTS -->
	<script src="${ctx}/assets/scripts/app.js" type="text/javascript"></script>
	<script src="${ctx}/assets/scripts/index.js" type="text/javascript"></script>
	<script src="${ctx}/assets/scripts/tasks.js" type="text/javascript"></script>

	<script type="text/javascript" src="${ctx}/assets/plugins/select2/select2.min.js"></script>
	<script src="${ctx}/assets/plugins/bootstrap-modal/js/bootstrap-modalmanager.js" type="text/javascript" ></script>
	<script src="${ctx}/assets/plugins/bootstrap-modal/js/bootstrap-modal.js" type="text/javascript" ></script>
	<script src="${ctx}/assets/scripts/table-advanced.js?t=202004022058"></script>
	<!-- END PAGE LEVEL SCRIPTS -->
	<script>
		jQuery(document).ready(function() {    
		   App.init(); // initlayout and core plugins
		   $('#A').addClass("active");
		   $('#A3').addClass('active');
		   TableAdvanced.init();
		   $.ajax({
				type:"POST",
				url:"${ctx}/wuzi/yjjsList.do",
				dataType:"html",
				async:false,
				success:function(data){
					$("#yjjs").html(data);
				}
			});
		   	<c:if test="${active==2}">
			   	$.ajax({
					type:"POST",
					url:"${ctx}/wuzi/yjspList.do",
					dataType:"html",
					async:false,
					success:function(data){
						$("#yjsp").html(data);
					}
				});
		   	</c:if>
		   	<c:if test="${active==4}">
			   	$.ajax({
					type:"POST",
					url:"${ctx}/wuzi/yjrzList.do",
					dataType:"html",
					async:false,
					success:function(data){
						$("#yjrz").html(data);
					}
				});
		   	</c:if>
		   	<c:if test="${active==5}">
			   	$.ajax({
					type:"POST",
					url:"${ctx}/liucheng/yiJiaoListAjax.do",
					dataType:"html",
					async:false,
					success:function(data){
						$('#yjlcgl').html(data);
					}
				});
		   	</c:if>

            $('#yjspTab').click(function(){
                $.ajax({
                    type:"POST",
                    url:"${ctx}/wuzi/yjspList.do",
                    dataType:"html",
                    async:false,
                    success:function(data){
                        $("#yjsp").html(data);
                    }
                });
            });

            $('#yjrzTab').click(function(){
                $.ajax({
                    type:"POST",
                    url:"${ctx}/wuzi/yjrzList.do",
                    dataType:"html",
                    async:false,
                    success:function(data){
                        $("#yjrz").html(data);
                    }
                });
            });

            $('#yjlcglTab').click(function(){
                $.ajax({
                    type:"POST",
                    url:"${ctx}/liucheng/yiJiaoListAjax.do",
                    dataType:"html",
                    async:false,
                    success:function(data){
                        $('#yjlcgl').html(data);
                    }
                });
            });

            // 全选与反选
            $('.table').find('thead').find('input[type="checkbox"]').click(function () {
				var _$item = $(this).parents('table').find('tbody').find('input[type="checkbox"]');
            	if ($(this).attr("checked")) {
					_$item.attr("checked", true);
					_$item.parent().addClass("checked");
				} else {
					_$item.attr("checked", false);
					_$item.parent().removeClass("checked");
				}
			});

            $('#yjspPiSubmit').click(function(){
                $.ajax({
                    type:"POST",
                    data:$('#yjspForm').serialize(),
                    url:"${ctx}/wuzi/yjspPiSubmit.do",
                    dataType:"json",
                    async:false,
                    success:function(data){
                        $.ajax({
                            type:"POST",
                            url:"${ctx}/wuzi/yjspList.do",
                            dataType:"html",
                            success:function(data){
                                $("#yjsp").html(data);
                            }
                        });
                    }
                });
            });

            $('#boHuiPL').click(function(){
                $.ajax({
                    type:"POST",
                    data:$('#yjspForm').serialize(),
                    url:"${ctx}/wuzi/yjspPL.do",
                    dataType:"json",
                    async:false,
                    success:function(data){
                        if(data.result=="none"){
                            alert("未选择审批内容！");
                        }else{
                            $('#yjspForm').attr("action", "${ctx}/wuzi/yjBHPL.do").attr("target","_blank").submit();
                        }
                    }
                });
            });

            $('#yjrzPiSubmit').click(function(){
                $.ajax({
                    type:"POST",
                    data:$('#yjrzForm').serialize(),
                    url:"${ctx}/wuzi/yjrzPiSubmit.do",
                    dataType:"json",
                    async:false,
                    success:function(data){
                        $.ajax({
                            type:"POST",
                            url:"${ctx}/wuzi/yjrzList.do",
                            dataType:"html",
                            success:function(data){
                                $("#yjrz").html(data);
                            }
                        });
                    }
                });
            });

            $('#yjjsPL').click(function(){
                $.ajax({
                    type:"POST",
                    data:$('#yjjsForm').serialize(),
                    url:"${ctx}/wuzi/yjjsPLTY.do",
                    dataType:"json",
                    async:false,
                    success:function(data){
                        $.ajax({
                            type:"POST",
                            url:"${ctx}/wuzi/yjjsList.do",
                            dataType:"html",
                            success:function(data){
                                $("#yjjs").html(data);
                            }
                        });
                    }
                });
            });

            $('#yjjsBHPL').click(function(){
                $.ajax({
                    type:"POST",
                    data:$('#yjjsForm').serialize(),
                    url:"${ctx}/wuzi/yjjsPL.do",
                    dataType:"json",
                    async:false,
                    success:function(data){
                        if(data.result=="none"){
                            alert("未选择审批内容！");
                        }else{
                            $('#yjjsForm').attr("action", "${ctx}/wuzi/yjTHPL.do").attr("target","_blank").submit();
                        }
                    }
                });
            });

            setActiveTab();
		});

		function setActiveTab() {
		    var activeTab = $('.nav-tabs').find('li:first');
            activeTab.find('a').trigger('click');
            activeTab.addClass('active');
		}
		
		var yiJiaoRK=function(id){
			$.ajax({
				type:"GET",
				url:"${ctx}/wuzi/yiJiaoRK.do?id="+id,
				dataType:"json",
				async:false,
				success:function(data){
					if(data.result=="success"){
						alert('移交入库确认！');
						$.ajax({
							type:"POST",
							url:"${ctx}/wuzi/yjspList.do",
							dataType:"html",
							success:function(data){
								//$("#yjsp").html(data);
								document.location.reload();
							}
						});
					}
				}
			});
		}
		
		var yiJiaoJieShou=function(id){
			$.ajax({
				type:"GET",
				url:"${ctx}/wuzi/yiJiaoJieShou.do?id="+id,
				dataType:"json",
				async:false,
				success:function(data){
					if(data.result=="success"){
						alert('移交接收确认！');
						window.location.reload();
					}
				}
			});
		}
		
		var yiJiaoRZ=function(id){
			$.ajax({
				type:"GET",
				url:"${ctx}/wuzi/yiJiaoRZ.do?id="+id,
				dataType:"json",
				async:false,
				success:function(data){
					if(data.result=="success"){
						alert('移交确认！');
						$.ajax({
							type:"POST",
							url:"${ctx}/wuzi/yjrzList.do",
							dataType:"html",
							success:function(data){
								$("#yjrz").html(data);
							}
						});
					}
				}
			});
		}
		function plTongGuo508() {
			var data = $('#yiJiaoForm508').serialize();
			if (data != '') {
				tongGuo(data);
			} else {
				alert('请至少选择一条记录！');
			}
		}
		function plTongGuo() {
			var data = $('#yiJiaoForm').serialize();
			if (data != '') {
				tongGuo(data);
			} else {
				alert('请至少选择一条记录！');
			}
		}
		function yiJiaoLiuChengTongGuo(yiJiaoId) {
			tongGuo({yiJiaoId: yiJiaoId});
        }

        function tongGuo(data) {
			$.ajax({
				type:"POST",
				url:"${ctx}/wuzi/yijiao/liucheng/tongguo.do",
				data: data,
				dataType:"JSON",
				success:function(result){
					if (result.success) {
						alert('审批成功！');
						location.reload();
					} else {
						alert('审批失败！');
					}
				}
			});
		}
	</script>
	<!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>